import { ISysGroup } from '/@/views/fileattachment/api/interface';
import { ISysPerson } from '/@/views/fileattachment/api/interface';
import { ISysOrg } from '/@/views/fileattachment/api/interface';

export interface ICompOffOvertimeLink {
    CompOffRequestBillId: string;
    OvertimeRequestBillId: string;
    HoursUsed: number;
}

export interface ISysDailyCompOffRequestBill {
    ID?: string | null;
    PersonId: null;
    Person?: ISysPerson;
    StaffNo: string | null;
    Name: string | null;
    StartTime: Date | null;
    EndTime: Date | null;
    Days: string | null;
    Reason: string | null;
    CompOffType?: '正常调休' | '等时调休' | null;
    CompOffHours: string | null;
    CompOffOvertimeLinks: ICompOffOvertimeLink[] | null;
    Approver: string | null;
    ApprovalTime: Date | null;
    GroupId: null;
    Group?: ISysGroup;
    OrgId: null;
    Org?: ISysOrg;
    BillCode: string | null;
    BillStatus?: '草稿' | '正文' | null;
    WorkflowStatus?: '待提交' | '提交中' | '审核中' | '已完成' | '已取消' | '待处理' | '处理中' | '已处理' | null;
    Remark: string | null;
}

export interface ISysDailyCompOffRequestBillVm {
    Entity: ISysDailyCompOffRequestBill;
    ActionName?: string | null;
    IsMyApprove?: boolean | null;
    OvertimeUsages?: Record<string, number>;  // Key: 加班申请单ID, Value: 使用的加班小时数
    SelectedCompOffOvertimeLinksIds: string[];
    Remark?: string | null;
}

export interface ISysDailyCompOffRequestBillView extends ISysDailyCompOffRequestBill {

    CompOffOvertimeLinksNames: string[];
}

export interface ISysDailyCompOffRequestBillQuery {
    PersonId?: string | null;
    StaffNo?: string | null;
    Name?: string | null;
    StartTime?: Date | null;
    EndTime?: Date | null;
    Days?: string | null;
    Reason?: string | null;
    CompOffType?: number | null;
    CompOffHours?: string | null;
    CompOffOvertimeLinks?: string | null;
    Approver?: string | null;
    ApprovalTime?: Date | null;
    GroupId?: string | null;
    OrgId?: string | null;
    BillCode?: string | null;
    BillStatus?: number | null;
    WorkflowStatus?: number | null;
    Remark?: string | null;
}